import { Injectable } from '@nestjs/common';

const msg = '请求成功';
const code = 0;

@Injectable()
export class GirlService {
  getGirls() {
    return {
      code,
      data: ['小红', '翠花', '妲己1'],
      msg,
    };
  }

  addGirl() {
    return {
      code,
      data: {
        id: 1,
        name: '大梨',
        age: 27,
      },
      msg,
    };
  }
  getGirlById(id: number) {
    let reJson = {};
    switch (id) {
      case 1:
        reJson = { id: 1, name: '大梨', age: 27 };
        break;
      case 2:
        reJson = { id: 2, name: '小红', age: 27 };
        break;
      case 3:
        reJson = { id: 3, name: '翠花', age: 27 };
        break;
      case 4:
        reJson = { id: 4, name: '妲己', age: 27 };
        break;
    }
    return {
      code,
      data: reJson,
      msg,
    };
  }
}
